package com.abc.springboot.util;

import org.hibernate.validator.constraints.Length;
import org.springframework.stereotype.Component;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.Pattern;

public class LoginData {

    @Min(10000000000L)
    @Max(99999999999L)
    private long account;

    private String password;

    public LoginData() {
    }

    public LoginData(@Pattern(regexp = "^\\d{11}$", message = "手机号必须为11位数字") long account, String password) {
        this.account = account;
        this.password = password;
    }

    public long getAccount() {
        return account;
    }

    public void setAccount(long account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return "LoginData{" +
                "account=" + account +
                ", password='" + password + '\'' +
                '}';
    }
}
